package gui;

import java.util.ArrayList;
import org.eclipse.swt.widgets.Display;

public class DiagramController {
	
	private DiagramEditor dEditor;
	
	public DiagramController() {
		try {
			Display display = Display.getDefault();
			dEditor = new DiagramEditor(display);
			//dEditor.open();
			dEditor.layout();

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public void drawShapes(ArrayList<Shape> shapes) {
		for (int i = 0; i < shapes.size(); i++) {
			shapes.get(i).DrawShape(dEditor.getCanvas());
		}
	}

	public DiagramEditor getdEditor() {
		return dEditor;
	}
	
	public void openEditor(){
		dEditor.open();
	}

}
